<?php
TImport('location');

if($html->getContent('type')=='inquiryhotel')
{
    $hotel      = $html->getContent('hotel');
    $linkhotel  = getLinkHotel($hotel['iParentId'],$hotel['cUrlString']);
    
    $html->setContent('cMetaTitle',$html->getContent('cMetaTitle').' - '.$hotel['cName']);
    $html->setContent('cIntro',str_replace('{HOTELNAME}','<a href="'.$linkhotel.'">'.$hotel['cName'].'</a>',$html->getContent('cIntro')));
    
    $html->addJs('jquery-1.4.2.min.js');
    $html->addJs('jquery-ui.js');
    $html->addCss('ui-lightness/jquery-ui.css');
    
    ImportClass('country');
    $country    = new Country;
    
    $listlocation   = ListAllLocation();
}
else if($html->getContent('type')=='hotel')
{
    $locations      = ListLocationById($html->getContent('iParentId'));
    $listPhotos     = ListPhotosHotel($html->getId());
    $otherhotels    = ListOtherHotel($html->getContent('iTypeId'),$html->getContent('iParentId'), $html->getId());
    
    TImport('tour');
    $tours          = ListTourByLocation($html->getContent('iParentId'));
    $linksendinquiry= getLinkSendInquiryHotel().$html->getContent('cUrlString').'.htm';
    
    TImport('review');
    $reviews        = ListReview($html->getId(),'hotel');
        
    if($html->getContent('iPromotion')==1)
    {
        TImport('promotions');
        $promotion      = GetPromotionById($html->getId(),'hotel');
    }
}else
{
    if($html->getContent('type')=='location')
    {
        $locationid = $html->getContent('iId');
    }
    $cid        = gpc_getStringPost('cid');
    $ctype      = gpc_getStringPost('ctype');
    $allHotel    = ListAllHotel();
    if($ajax==true)
    {        
        echo showSplitPage();
        echo $allHotel;
        echo showSplitPage();
        exit;
    }
    $listlocation   = ListAllLocation();
    $listhoteltype  = ListHotelType();      
}
?>